ARG BASE_OS=alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3

FROM ${BASE_OS}

ARG PYTHON_VERSION=3.10.13 \
    OS_SUFFIX=3

LABEL org.opencontainers.image.title="Python" \
      org.opencontainers.image.version="${PYTHON_VERSION}-${OS_SUFFIX}"

ENV PYTHON_VERSION=${PYTHON_VERSION}


RUN dnf update -y && \
    dnf install -y python3-${PYTHON_VERSION} python3-pip python3-setuptools; \
    dnf clean all

RUN set -eux; \
    \
    export PYTHONDONTWRITEBYTECODE=1; \
    \
    pip --version; \
    pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/; \
    pip config set install.trusted-host mirrors.aliyun.com

CMD ["python3"]
